home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
nhx
/
mainform.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
5KB
|
219 lines
VERSION 2.00
Begin Form MainForm
Caption = "NHX"
ClientHeight = 5085
ClientLeft = 975
ClientTop = 1965
ClientWidth = 7365
Height = 5775
Icon = MAINFORM.FRX:0000
Left = 915
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 5085
ScaleWidth = 7365
Top = 1335
Width = 7485
Begin CommandButton Command2
Caption = "quit"
Height = 375
Left = 6240
TabIndex = 1
Top = 4080
Width = 855
End
Begin Timer Timer1
Interval = 500
Left = 960
Top = 3960
End
Begin TextBox TextTopic
Height = 3615
Index = 0
Left = 120
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 0
TabStop = 0 'False
Text = "Text1"
Top = 120
Width = 6975
End
Begin Label StatusBar
BackColor = &H00C0C0C0&
Caption = "statusbar"
FontBold = 0 'False
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 9.75
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 375
Left = 0
TabIndex = 2
Top = 4680
Width = 7335
End
Begin Menu mF
Caption = "&File"
Begin Menu mFN
Caption = "&New"
End
Begin Menu mFO
Caption = "&Open..."
End
Begin Menu mFS
Caption = "&Save"
End
Begin Menu mFX
Caption = "e&Xit"
End
Begin Menu mFA
Caption = "save &As"
End
End
Begin Menu mE
Caption = "&Edit"
Begin Menu mEC
Caption = "&Copy"
End
Begin Menu mEL
Caption = "copy &Link"
End
Begin Menu mEP
Caption = "&Paste"
End
Begin Menu mEPL
Caption = "paste l&Iink"
End
End
Begin Menu mB
Caption = "&Browse"
Begin Menu mBG
Caption = "&Goto"
End
Begin Menu mBB
Caption = "&Back"
End
End
Begin Menu mH
Caption = "&Help"
Begin Menu mHA
Caption = "&About..."
End
Begin Menu mHI
Caption = "&Index"
End
Begin Menu mHS
Caption = "&Search..."
End
End
End
Sub Command2_Click ()
DoQuit
End Sub
Sub Command2_KeyDown (KeyCode As Integer, Shift As Integer)
MainFormKeyPressHandler KeyCode, Shift
End Sub
Sub DoQuit ()
a% = MsgBox("save the hypertext?", 4 Or 32, APPNAME$)
If a% Then DoSave
End
End Sub
Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
a$ = TextTopic(CurrentTopic%).seltext
If Button = 2 Then
OldTopic% = CurrentTopic%
NewTopic% = FindTopic(a$)
If NewTopic% Then
HideTopic OldTopic%
ShowTopic NewTopic%
End If
Else
LinkEdit.Show 1
End If
MainForm.TextTopic(CurrentTopic%).enabled = -1
StatusBar.caption = "ready"
End Sub
Sub MainFormKeyPressHandler (KeyCode As Integer, Shift As Integer)
KEY_ESCAPE% = &H1B
StatusBar.caption = "!!! Cancelled !!!"
Beep
If KeyCode = KEY_ESCAPE% Then ' ESC key pressed
MainForm.TextTopic(CurrentTopic%).enabled = -1
MainForm.TextTopic(CurrentTopic%).sellength = 0
StatusBar.caption = "ready"
End If
End Sub
Sub mBB_Click ()
temp% = CurrentTopic%
CurrentTopic% = OldTopic%
OldTopic% = temp%
ShowTopic CurrentTopic%
HideTopic OldTopic%
MainForm.TextTopic(CurrentTopic%).enabled = -1
End Sub
Sub mBG_Click ()
GoToTop.Show 1
End Sub
Sub mEC_Click ()
ni
End Sub
Sub mEL_Click ()
ni
End Sub
Sub mEP_Click ()
ni
End Sub
Sub mEPL_Click ()
ni
End Sub
Sub mFA_Click ()
ni
End Sub
Sub mFN_Click ()
ni
End Sub
Sub mFO_Click ()
ni
End Sub
Sub mFS_Click ()
DoSave
End Sub
Sub mFX_Click ()
DoQuit
End Sub
Sub Timer1_Timer ()
Static PrevSel$
If PrevSel$ = TextTopic(CurrentTopic%).seltext Then Exit Sub
If Left$(TextTopic(CurrentTopic%).seltext, 1) = "[" Then
If InStr(Right$(TextTopic(CurrentTopic%).seltext, 2), "]") > 0 Then
TextTopic(CurrentTopic%).enabled = 0
StatusBar.caption = "Press Left Button to edit link, Right button to navigate"
End If
End If
PrevSel$ = TextTopic(CurrentTopic%).seltext
End Sub